<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition>
	<h:form prependId="false">

		<p:growl id="messages" showDetail="true" />

		<p:dataTable var="items" value="#{mProperty.allPropFromAcc}"
			paginator="true" paginatorAlwaysVisible="false" id="prop_table"
			rows="10" dynamic="true" onRowEditUpdate="messages"
			rowEditListener="#{mProperty.statusRowUpdate}">

			<p:column>
				<f:facet name="header"></f:facet>
				<p:rowToggler />
			</p:column>

			<p:column sortBy="#{items.postDate}">
				<f:facet name="header">Post Date</f:facet>

				<h:outputText value="#{items.postDate}" />
			</p:column>

			<p:column sortBy="#{items.title}" filterBy="#{items.title}"
				filterMatchMode="contains">
				<f:facet name="header">Title</f:facet>
				<h:outputText value="#{items.title}" />
			</p:column>

			<p:column style="width:150px" sortBy="#{items.status}">
				<f:facet name="header">Status</f:facet>
				<p:cellEditor>
					<f:facet name="output">
						<h:outputText value="#{mProperty.validStatus(items.status)}" />
					</f:facet>
					<f:facet name="input">
						<h:selectOneMenu value="#{items.status}" style="width: 100px">
							<f:selectItem itemValue="true" itemLabel="Active" />
							<f:selectItem itemValue="false" itemLabel="Deactive" />
						</h:selectOneMenu>
					</f:facet>
				</p:cellEditor>
			</p:column>


			<p:column headerText="Publish">
				<p:rowEditor />
			</p:column>

			<p:rowExpansion>

				<div class="box3">
					<div class="image_box">
						<h:graphicImage value="#{mProperty.getPath(items.propID)}"
							width="150px" height="150px"></h:graphicImage>
					</div>
					<div class="prop_info">
						<ul class="list1">
							<li><strong>Owner: </strong> <h:outputText
									value="#{items.account.name}" />
							</li>
							<li><strong>Country: </strong> <h:outputText
									value="#{items.country}" />
							</li>
							<li><strong>State: </strong> <h:outputText
									value="#{items.state}" />
							</li>
							<li><strong>Address: </strong> <h:outputText
									value="#{items.address}" />
							</li>
							<li><strong>ID: </strong> <h:outputText
									value="#{items.propID}" />
							</li>
						</ul>
						<span class="details_link"> <h:commandLink action="#{updatePropertyBean.redirectUpdate}" 
					value=""><h:graphicImage value="/resources/images/search-icon.gif"> 
							<b style="color:white">Update</b> 
						</h:graphicImage>
					<f:setPropertyActionListener value="#{items.propID}"
						target="#{updatePropertyBean.pid}" />
				</h:commandLink> </span>
					</div>
				</div>
			</p:rowExpansion>
		</p:dataTable>
	</h:form>
</ui:composition>
</html>